package com.tyun.common.utils;

/**
 * @author taocongcong
 * @create 2018-06-08 15:59
 */
public class BaseUtil {

    public static final String NUMBER_CONTENT="0123456789";

    /**
     * 获取文件的后缀
     */
    public static String acceptFileType(String fileName){
        String suffix = fileName.substring(fileName.lastIndexOf(".") + 1);
        return suffix;
    }

    /**
     * 获取随机数
     */
    public static String acceptRandom(String content,int num){
        StringBuffer sb=new StringBuffer();
        for (int i=0;i<num;i++){
            int id=(int)((Math.random())*(content.length()-1));
            sb.append(content.substring(id,id+1));
        }
        return sb.toString();
    }

}
